package com.lxy.dataservice.controller;

import com.coxautodev.graphql.tools.GraphQLMutationResolver;
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.lxy.dataservice.entity.Test;
import com.lxy.dataservice.service.TestService;
import com.nip.db.mongodb.utils.tips.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * TestController
 *
 * @author < a href=" ">ZhangYang</ a>
 * @version v1.0.01
 * @date 2019-12-31 12:56
 */
@Component
public class TestController implements GraphQLQueryResolver, GraphQLMutationResolver {
  @Autowired
  TestService testService;

  public Response saveTest(Test entity) {
    return testService.saveTest(entity);
  }

  public List<Test> findAllTest(){
    return testService.findAllTest();
  }
}
